SUBROUTINE delmem
USE global
IMPLICIT NONE
INTEGER :: i

! lammps file
DEALLOCATE(lammps_file)
! basis for lattice
DEALLOCATE(basis)
! number of layers to be removed from simulation box
IF(n_rlayer.GT.0) THEN
   ALLOCATE(remove_layer1(n_rlayer))
   ALLOCATE(remove_layer2(n_rlayer))
END IF
! cell box
DEALLOCATE(cell_box_map)
DEALLOCATE(cell_box)
DEALLOCATE(lattice)
DEALLOCATE(atom)
END SUBROUTINE delmem
